package homework.homework01;

public class Employee {//员工类
    private int no;//编号
    private String name;//姓名
    private int age;//年龄
    private int sal;//薪资

    //有参构造
    public Employee(int no, String name, int age, int sal) {
        this.no = no;
        this.name = name;
        this.age = age;
        this.sal = sal;
    }
    //无参构造
    public Employee(){}
    //get and set获取和修改属性方法
    public int getNo() {
        return no;
    }

    public void setNo(int no) {
        this.no = no;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getSal() {
        return sal;
    }

    public void setSal(int sal) {
        this.sal = sal;
    }
    public String getInfo(){
        return "编号："+no+" 姓名："+name+" 年龄："+age+" 薪资："+sal;
    }
}
